Skip to content

fix(company-os): CEO change and clear require company owner or admin (#20542) - #20559

Closed
mrveiss wants to merge 4 commits into
mainfrom
issue-20542-ceo-owner-admin
Closed

mrveiss wants to merge 4 commits into
mainfrom
issue-20542-ceo-owner-admin

Conversation

@mrveiss

@mrveiss mrveiss commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Thinking Path

The CEO designation routes checked company access only, so any member could change or clear the CEO. The new company settings page in #20550 would put that one click away from every member, so the backend rule lands first.

What Changed

  • llc/api/company_ceo.py: PUT and DELETE call require_company_admin_unless_platform, the rule llc/api/approvals.py and company_members.py use. Owners, admins and platform admins pass; a member, guest, lead or non-member gets 403; another company still gets 404. GET is unchanged.

Verification

  • test_company_ceo_routes_15872.py: 20 passed, including refusals with the stored CEO unchanged. A real membership row is used.
  • Not run: the e2e test that sets the CEO as company creator, who is an owner, so it should pass. OpenAPI types not regenerated; response schemas are unchanged.
  • An agent credential with no user membership now gets 403; no such path through these routes was found.

Model Used

Claude Sonnet for the implementation, Claude Opus for coordination.

Single-issue rationale

Refs #20542 and does not close it: the screen hiding its controls needs a server fact that no neighbouring route offers yet, so for now a member sees the refusal. Lands before #20550.

@mrveiss mrveiss added this to the M3 - Refined GUI complete milestone Nov 1, 2026
@mrveiss mrveiss added the phase:M3.7 Company OS, Automation and BI screens label Nov 1, 2026
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 32 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 87eae8a and 776a5a3.

Files selected for processing: 2
  • autobot-backend/llc/api/company_ceo.py
  • autobot-backend/llc/tests/test_company_ceo_routes_15872.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

✅ SSOT Configuration Compliance: Passing

🎉 No new hardcoded values of either class — ssot and other both block.

Known backlog in pipeline-scripts/hardcoded_values_baseline.txt is suppressed and tracked in #14371.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Notice: 29 open PRs — past the runaway threshold (25)

This is not a request to defer this PR. There is no cap on open PRs (#19397) -- nothing blocks opening or pushing a PR.

This notice only means the count is high enough to be worth a glance for a runaway — something opening PRs in a loop, or a merge pipeline that has stalled so nothing is draining.

Currently open:

If the queue is draining normally, ignore this. Otherwise:

  1. Check whether CI is dispatching at all — see the ci-dispatch-watchdog status on these PRs
  2. Approved PRs land through the merge train the coordinator sequences (merge commits, never squash) -- check the open chore(merge-train) PR is moving, not each PR on its own
  3. Look for a loop opening near-identical PRs

Warn-only runaway detector — .github/workflows/pr-queue-gate.yml. It never blocks a merge.

@mrveiss

mrveiss commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

Code review on PR #20559 (head c3e0f9b): approve.

Read only; I didn't run the tests. PUT and DELETE need owner or admin after the tenant check, so a member gets 403 and another company 404, and the tests assert the store is unchanged through the mounted app. No other HTTP route writes the designation. Low: no test covers a platform admin with no membership, so dropping platform_admin= would go unnoticed. The screen's controls remain #20542's second criterion, so Refs is correct.

This was referenced Nov 1, 2026
This was referenced Nov 2, 2026
@mrveiss

mrveiss commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Landed through the merge train (PR #20594), merge 655489c, with the content check clean. Proof: git rev-list --no-merges --count origin/main..head = 0; the head moved only by syncing main after the train froze it. Closing and deleting the branch.

@mrveiss mrveiss closed this Nov 2, 2026
@mrveiss
mrveiss deleted the issue-20542-ceo-owner-admin branch November 2, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

phase:M3.7 Company OS, Automation and BI screens

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant